#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "dialog.h"
#include "form.h"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->resize(1200,800);
    //设置一个图标
    QIcon icon(":/6.png");
    this->setWindowIcon(icon);
    this->setWindowTitle("网上投票系统");

}

MainWindow::~MainWindow()
{
    delete ui;
}
//跳转进入登录界面
void MainWindow::on_pushButton_clicked()
{
    //这里不指定父元素
    //当进入新窗口时，主窗口会关闭
    //新窗口称为顶层窗口
    db=connect1();
    Dialog* dialog=new Dialog();
    dialog->show();
    //for test
//    Form* form=new Form();
//    form->show();

    this->close();
}

